<?php echo $this->render("header.phtml"); ?>
<label class="title">Member profile - list pending member.</label>
<div class="horiz_sep">&nbsp;</div>
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<?php $utilities = $this->utilities; ?>
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" width="100%" border="0">
			<?php
				$i=0; 
				$count = count($this->users);
				foreach ($this->users as $user) {
					$i++;
					if ($i % 3 == 0){												
						// Neu $i chia het cho 3.
						echo '</td><td style="padding-top:5px;" valign="bottom">';						
					}
					else{
						// Neu $i khong chia het cho 3.
						if ($i%3 == 1) 
							echo '<tr><td width="33%" style="padding-top:5px;" valign="bottom">';
						else 
							echo '</td><td width="33%" style="padding:5px 5px 0px 5px;" valign="bottom">';
					}					
			?>    	
		    		<table cellpadding="0" cellspacing="0" width="100%" style="border: 1px solid #cccccc;">
		    			<tr bgcolor="#81d2f6">
		    				<td colspan="2" style="border-bottom: 1px solid #cccccc; padding:3px;" align="right">		    					
		    					<a href="javascript:eway.confirm('<? echo $this -> baseUrl ?>/<?= $this->contextPath ?>/activated/user_id/<?php echo $user->usr_id; ?>', 'Are you sure you want to activate this member?');">Activate</a>
		    					&nbsp;&nbsp;
		    					<a href="<? echo $this -> baseUrl ?>/<?= $this->contextPath ?>/edit-pending/user_id/<?php echo $user->usr_id; ?>/page/<?php echo $this->currentPage; ?>">Edit</a>
		    					&nbsp;&nbsp;
		    					<a href="javascript:eway.confirm('<? echo $this -> baseUrl ?>/<?= $this->contextPath ?>/delete-pending-member/user_id/<?php echo $user->usr_id; ?>', 'Are you sure you want to delete this member?');">Delete</a>
		    				</td>
		    			</tr>
		    			<tr>
		    			<?php
		    				$tip_data  = "<b>Account/Mobile: </b>".$user->usr_mobile; 
		    				$tip_data .= "<p><b>Fullname: </b>".$user->usr_fullname."</p>";
		    				$tip_data .= "<p><b>Email: </b>".$user->usr_email."</p>";
		    				$tip_data .= "<p><b>Coin amount: </b>".$user->usr_coin_amount." ".Constant::MONEY_EXTENDED."</p>";
		    				$tip_data .= "<p><b>Created date: </b>".$utilities->formatdate($user->usr_created_date)."</p>";
		    				$tip_data .= "<p><b>Birthday: </b>".$utilities->formatdate($user->usr_birthday)."</p>";
		    				$tip_data .= "<p><b>Activated: NO</b>"."</p>";
		    				$tip_data .= "<b>Role: ".$user->usr_role."</b>";
		    			?>
		    				<td onmouseover="Tip('<?php echo $tip_data; ?>')">
		    					<table cellpadding="0" cellspacing="5" width="100%">
		    						<tr>
					    				<td><b>Account:</b></td>
					    				<td>
					    					<b><?php echo $user->usr_mobile; ?></b>
					    				</td>
					    			</tr>
					    			<tr>
					    				<td><b>Role:</b></td>
					    				<td>
					    					<b><?php echo $user->usr_role; ?></b>
					    				</td>
					    			</tr>
			    					<tr>
					    				<td>Name:</td>
					    				<td>
					    					<?php echo $user->usr_fullname; ?>
					    				</td>
					    			</tr>
					    			<tr>
					    				<td>Email:</td>
					    				<td>
					    					<a href="mailto:<?php echo $user->usr_email; ?>"><?php echo $user->usr_email; ?></a>					    					
					    				</td>
					    			</tr>					    			
					    			<tr>
					    				<td>Coin:</td>
					    				<td>
					    					<?php echo $user->usr_coin_amount." VND"; ?>
					    				</td>
					    			</tr>
		    					</table>
		    				</td>
		    			</tr>    			
		    		</table>    		
		    	</td>
		    <?		    
		    	if ($i%3== 0){
		    		echo "</td></tr>";
		    	} 
		    	else{
		    		if ($i == $count) {
		    			$colspan = 3- $i%3;
		    			echo "</td><td colspan=$colspan>&nbsp</td></tr>";
		    		}
		    	}
				} // End for.
			?> 			
			</table>
		</td>
	</tr>	
	<tr>
		<td align="center">
			<?php echo $this->page; ?>
		</td>
	</tr>
</table>
<?php echo $this->render("footer.phtml"); ?>